#include<iostream>
using namespace std;
const int N = 1e5 + 10, M = 31 * N;
int son[M][2];
int arr[N];
int index;
int n;
void insert(int u)
{
	int p = 0;
	for (int i = 30; i >= 0; i--) {
		int s = u >> i & 1;
		if (!son[p][s]) {
			son[p][s] = ++index;
		}
		p = son[p][s];
	}
}

int find(int u)
{
	int p = 0;
	int res = 0;
	for (int i = 30; i >= 0; i--) {
		int s = u >> i & 1;
		if (!son[p][!s]) {
			res = res * 2 + !s;
			p = son[p][!s];
		}
		else {
			p = son[p][s];
			res = res * 2 + s;
		}
	}
	return res;
}
int main()
{
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
		insert(arr[i]);
	}
	int res = 0;
	for (int i = 0; i < n; i++) {
		int ret = find(arr[i]);
		res = max(res, res^arr[i]);
	}
	cout << res << endl;
	return 0;
}